import * as api from '../api/api'
import province from '../data/city-data/province';
import city from '../data/city-data/city';
export function queryProvinces() {
  // return api.get('/area/provinces')
  return new Promise((resolve,reject)=>{
    const results = {};
    province.forEach((el,index)=>{
      results[el.label] = city[index].reduce((a,b)=>(a[b.label] = true,a));
    });
    resolve(results);
  });
}

export function queryData() {
  return new Promise((resolve,reject)=>{
    const results = {};
    province.forEach((el,index)=>{
      results[el.label] = city[index].reduce((a,b)=>(a[b.label] = true,a),{});
    });
    console.log(results);
    resolve(results);
  });
}
